//package cn.wolfcode.springdemo_2;
//
//import cn.wolfcode.springdemo_2.config.JavaConfig;
//import cn.wolfcode.springdemo_2.domain.SomeBean;
//import org.junit.Test;
//import org.junit.runner.RunWith;
//import org.springframework.context.ApplicationContext;
//import org.springframework.context.annotation.AnnotationConfigApplicationContext;
//import org.springframework.test.context.ContextConfiguration;
//import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
//
//@RunWith(SpringJUnit4ClassRunner.class)
//@ContextConfiguration(classes = {JavaConfig.class})
//public class SpringDemoJunit {
//    @Test
//    public void  testJavaConfig(){
//        //1.加载配置类，创建spring容器
//        ApplicationContext ctx = new AnnotationConfigApplicationContext(JavaConfig.class);
//        //2.从容器中获取someBean对象
//        SomeBean someBean = ctx.getBean(SomeBean.class);
//        System.out.println(someBean);
//        someBean.destroy();
//        someBean.init();
//    }
//
//    @Test
//    public void  testJavaConfig2(){
//        //1.加载配置类，创建spring容器
//        ApplicationContext ctx = new AnnotationConfigApplicationContext(JavaConfig.class);
//        //2.从容器中获取someBean对象
//        SomeBean someBean = ctx.getBean(SomeBean.class);
//        System.out.println(someBean);
//        someBean.destroy();
//        someBean.init();
//    }
//}
